/* ARP public interface */

/* Copyright (C) 2009-2011 David Zanetti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#define ARP_H

/* process an arp packet coming in, returns non-zero if we have a reply
   prepared in the slot given */
uint8_t arp_process(uint8_t slot);

/* arp init. this cleans the arp table */
void arp_init(void);

/* resolve the MAC address of dst, for packet slot. returns E_NOTHING if it cannot resolve it, but promises to send the packet eventually */
/* otherwise, writes the MAC into dst_mac, which should be 6 octets */
uint8_t arp_resolve(uint8_t slot, uint8_t *dst, uint8_t *dst_mac);

/* if we have no arp for a packet after a while, discard the packet */
void arp_tick(void);
